package com.ea.eadp.nexus.test.workflow.pc.parentemail;

import org.openqa.selenium.WebDriver;
import org.testng.Assert;

import com.ea.eadp.nexus.test.pageDefinition.pc.ParentEmailChallengePage;
import com.ea.eadp.nexus.test.workflow.WorkflowElement;
import com.ea.eadp.nexus.test.workflow.WorkflowElementArgument;

public abstract class ParentEmailChallengeWorkflowElementBase
extends WorkflowElement {
    
    protected ParentEmailChallengePage page;
    
    public ParentEmailChallengeWorkflowElementBase(
        WebDriver driver,
        WorkflowElementArgument args
    ) {
        super(driver, args);
        page= new ParentEmailChallengePage(driver);
    }
    
    @Override
    public void init() {
        super.init();
        page.initPage();
    }
    
    @Override
    public void doPreVerification() {
        super.doPreVerification();
        Assert.assertEquals(
            page.txt_parentEmailAddress.getText(), args.parentEmail,
            "Wrong parent email address"
        );
    }
    
}
